package reflect;

import java.lang.reflect.Method;
import java.util.Scanner;
import java.util.concurrent.Callable;

public class ReflectDemo1 {
    public static void main(String[] args) throws ClassNotFoundException {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个类的完全限定名:");
        String className = scanner.nextLine();
        Class cls = Class.forName(className);
        String name = cls.getName();
        System.out.println(name);
        name = cls.getSimpleName();
        System.out.println(name);
        String packageName=cls.getPackage().getName();
        System.out.println("包名： "+packageName);
        Method[]methods=cls.getMethods();
        for (Method method:methods){
            System.out.println(method.getName());
        }
    }
}
